﻿#include "UBasePanel.h"

UBasePanel::UBasePanel(QWidget * parent)
{
	m_pTimer = nullptr;
	m_pDevData = nullptr;
	m_pCamerCtrMange = nullptr;
	m_pRobCtrMange = nullptr;
	m_pBasicData = nullptr;
}

UBasePanel::~UBasePanel()
{
}

void UBasePanel::initPanel(QString sGuid,CDevBase * pDev, CRBaseData * pRBaseData)
{
	m_sGuid = sGuid;
	m_pDev = pDev;
	m_pBasicData = pRBaseData;
	m_pRobCtrMange = ((CDevHy *)m_pDev)->m_pRobCtrMange;
	m_pCamerCtrMange = ((CDevHy *)m_pDev)->m_pCamerCtrMange;
	m_pDevData = m_pDev->m_pDevDataBase;
	init();
}


void UBasePanel::init()
{
}

void UBasePanel::refreshData(bool bRefresh)
{
	if (m_pTimer == nullptr)
		return;
	if (bRefresh)
	{
		if (!m_pTimer->isActive())
		{
			m_pTimer->start(1000);
		}
	}
	else
	{
		if (m_pTimer->isActive())
		{
			m_pTimer->stop();
		}
	}
}



